package com.rabbitmq.ChattingRoom.util.common.req;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

@Data
public class UserRegisterReq {

    @ApiModelProperty("用户名")
    @NotBlank(message = "用户名不能为空")
    @Size(min = 6,max = 16,message = "用户名长度必须在6-16之间")
    @Pattern(regexp = "^\\w+$",message = "用户名只能包含字母、数字和下划线")
    private String username;

    @ApiModelProperty("登陆密码")
    @NotBlank(message = "密码不能为空")
    @Size(min = 6,max = 16,message = "用户名长度必须在6-18之间")
    @Pattern(regexp = "^^\\w+$",message = "密码只能包含字母、数字和下划线")
    private String password;

    @ApiModelProperty("用户显示昵称")
    @NotBlank(message = "用户昵称不能为空")
    private String nickname;

    @ApiModelProperty("用户头像")
    private String img;

}
